package cn.hs.service.impl;

import cn.hs.entity.Demo;
import cn.hs.mapper.DemoMapper;
import cn.hs.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName TestImpl
 * @Description TODO
 * @Author CnYuu
 * @Date 2024年10月21日 14:15
 * @Version 1.0
 */
@Service
public class DemoServiceImpl implements DemoService {
    @Autowired
    private DemoMapper demoMapper;
    @Override
    public List<Demo> selectAll(Demo demo) {
        return demoMapper.selectAll(demo);
    }

    @Override
    public List<Demo> selectById(int id) {
        return demoMapper.selectById(id);
    }

    @Override
    public int insert(Demo demo) {
        return demoMapper.insertAll(demo);
    }

    @Override
    public int update(Demo demo) {
        return demoMapper.updateSelective(demo);
    }

    @Override
    public int delete(int id) {
        return demoMapper.deleteById(id);
    }
}
